// pages/find/seeMore/seeMore.js
const app = getApp()
var base_url = app.globalData.url
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    wx.getStorage({
      key: 'classSeemoreDatas',
      success: function (res) {
        that.setData({
          classSeemoreDatas: res.data
        })
      },
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  gotoSeeMorethis:function(res){
    var strs = new Array(); //定义一数组
    var id = res.currentTarget.dataset.name
    console.log(id)
    strs = id.split(",");
    wx.request({
      url: base_url + '/getAllclassesMoreThis/',
      method: 'POST',
      data: {
        shid: strs[0],
        cid: strs[1]
      },
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        if (res.data['flag'] == true) {

          var that = this
          console.log(strs[0])
          wx.setStorage({
            key: 'shid',
            data: strs[0],
            success: function (res) {
            console.log(res)
            }
          })
          wx.setStorage({
            key: 'cid',
            data: strs[1],
            success: function () {

            }
          })
          wx.setStorage({
            key: 'ccount',
            data: res.data['ccount'],
            success: function () {

            }
          })
          wx.setStorage({
            key: 'nocount',
            data: res.data['nocount'],
            success: function () {

            }
          })
          wx.setStorage({
            key: 'lst',
            data: res.data['lst'],
            success: function () {
              wx.navigateTo({
                url: '../seeMoreThis/seeMoreThis'
              })
            }
          })
          

        }
      }
    })
  }
})